<template>
	<view>
		<my-list ref="myList"
			:api="productList" :params="params" :transformRequestData="transformRequestData">>
			<template v-slot:card="{list}">
				<view class="product-list-wrapper">
					<view style="
					margin: 30rpx;height: 300rpx;display: flex;padding: 30rpx;
					border: 2rpx solid #ccc;box-shadow: 0px 2rpx 0px 4rpx  rgba(4,4,21, 0.1);
					border-radius: 20rpx;
					" v-for="(item,index) in list">
						<view style="width: 30%;height: 240rpx;">
							<image :src="item.products&& item.products.thump" style="width: 100%;height: 100%;" mode=""></image>
						</view>
						<view style="position: absolute;right: 60rpx;">
							<text>
								{{item.status_text || '已完成'}}
							</text>
						</view>
						<view style="width: 65%;display: flex;margin-left: 3%;justify-content:space-around;flex-direction:column;">
							<text>{{item.products.title}}</text>
							<text style="overflow: hidden; text-overflow: ellipsis; display: -webkit-box;-webkit-line-clamp: 2; -webkit-box-orient: vertical;">
								{{item.products.desc}}
							</text>
							<text>下单时间：{{item.createtime || '2024-08-22'}}</text>
						</view>
					</view>
				</view>
			</template>
		</my-list>
		
		<view class="" style="position: fixed;bottom: 100rpx;width: 50%;height: 100rpx;background: #fff;border-radius: 30rpx;
			margin-left: 25%;line-height: 100rpx;text-align: center;font-size: 35rpx;
		"
			@click="toKabao"
		>
			前往卡包
		</view>	
	</view>
</template>

<script>
	import request from '@/common/request.js';
	export default {
		data() {
			return {
				cardCur: 0,
				bannerList: [
				],
			
				tabIndex:0,
				modalName: null, //会员弹窗
			}
		},
		computed:{
			params() {
				return {
					tabId: this.tabIndex,
					limit:10
				};
			}
		},
		methods:{
			toKabao(){
				uni.navigateTo({
					url:"/pages/me/kabao"
				})
			},
			onPullDownRefresh() {
				this.$refs.myList.onRefresh();
			},
			onReachBottom() {
				this.$refs.myList.onMore();
			},
			transformRequestData(data) {
				console.log('data111', data.data.data)
				return data.data.data.data;
			},
			productList(value) {
				console.log('111',value)
				let opts = {
					url: 'api/gashapons/orderList',
					method: 'get'
				};
				const result =  request.httpTokenRequest(opts, value);
				return result;
			
			},
		},
	}
</script>

<style>
	
</style>